﻿@*@model IEnumerable<CPPaquetes.BusinessEntities.TBL_DESTINO>*@
@model IEnumerable<CPPaquetes.BusinessEntities.prc_destino_listar_padres_Result>

@{
    ViewBag.Title = "Viajes Falabella - Cotizar Paquetes";
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.ParameterData = "3860|58|lponce";
}
<script type="text/javascript">

    $(function () {
        $("#CboDestino").change(function () {

            var x = $("#CboDestino option:selected").val(); 
            $('#ArbolProgramas').load('@Url.Content("~/Home/ArbolProgramas?Id=")'+ x);
        });
    });

    $(document).ready(function () {
        var x = $("#CboDestino option:first").val(); ;
        $("#CboDestino option[value='" + x + "']").attr('selected', 'selected');
        $("#CboDestino").change();
    });
</script>
<input type="hidden" id="ParameterData" value="@ViewBag.ParameterData" />
<select id="CboDestino">
    @foreach (CPPaquetes.BusinessEntities.prc_destino_listar_padres_Result item in Model)
    {   
        <option value="@item.destino_id">@Html.DisplayFor(modelItem => item.nombre)</option>
    }
</select>

<div id="ArbolProgramas"></div>